package org.example.pojo;


public class BattleData {
    private int totalBattle     = 0;
    private int totalVictory    = 0;
    private int totalAssist     = 0;
    private int totalDeath      = 0;
    private int totalKill       = 0;

    /**
     * 计算胜率
     * @return 返回胜率
     */
    public float getOdds() {
        if (totalBattle == 0) { return 0.0f; }
        return (float) totalVictory / totalBattle;
    }

    /**
     * 计算kd
     * @return 返回KD
     */
    public float getKd() {
        if (totalDeath == 0) { return totalKill; }
        return (float) totalKill / totalDeath;
    }

    public int getTotalBattle() {
        return totalBattle;
    }

    public void setTotalBattle(int totalBattle) {
        this.totalBattle = totalBattle;
    }

    public int getTotalVictory() {
        return totalVictory;
    }

    public void setTotalVictory(int totalVictory) {
        this.totalVictory = totalVictory;
    }

    public int getTotalAssist() {
        return totalAssist;
    }

    public void setTotalAssist(int totalAssist) {
        this.totalAssist = totalAssist;
    }

    public int getTotalDeath() {
        return totalDeath;
    }

    public void setTotalDeath(int totalDeath) {
        this.totalDeath = totalDeath;
    }

    public int getTotalKill() {
        return totalKill;
    }

    public void setTotalKill(int totalKill) {
        this.totalKill = totalKill;
    }
}
